[Fix] Tasks keep retrying when provider billing fails - #509
Merged
Conversation
Contributor
|
No new code issues found. See task
Reviewed a085b5e |
Contributor
Author
|
@roomote-roomote address PR comment |
Contributor
|
I'm on it. I started a dedicated PR follow-up task for this request, and I'll keep updates here. See task |
Classify bare "Payment required" retry status messages as terminal so OpenCode does not keep backoff when only the status message is available.
mrubens
marked this pull request as ready for review
July 18, 2026 03:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
When a provider reports a billing, suspension, or payment-required failure as a retryable OpenCode session status, the worker now treats it as terminal: it aborts the OpenCode retry loop, surfaces the provider message, clears queued prompts, and ends the task. Message-only retry statuses such as bare
Payment required(no status code or error code) are classified the same way, matching howhandleSessionStatusactually invokes the classifier.Transient provider failures continue to use the existing retry/backoff behavior.
Why this change was made
Some providers mark account or billing failures as retryable. OpenCode then enters unbounded backoff while the task sits in a retry loop that cannot succeed. Roomote needs to recognize those failures from the status payload it actually receives—including message-only forms—and fail the task cleanly instead.
Impact
Tasks that hit terminal provider billing errors stop sooner with a clear provider message, instead of spinning on retries. Ordinary transient provider errors still retry as before. No UI changes.